﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserAdmin.aspx.cs" Inherits="UserAdmin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AspNetPager" Namespace="DotNet.AspNetPager" TagPrefix="webdiyer" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户管理</title>
    <meta name="Coding" content="JamSoft" />
    <meta name="Author" content="JamSoft@163.com" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <script type="text/javascript" src="../../../../Scripts/main.js"></script>
    <script type="text/javascript" src="../../../../Scripts/default.js"></script>
    <link rel="Stylesheet" rev="Stylesheet" type="text/css" href="../../../../Styles/Body.css" />
    <script type="text/javascript" language="javascript">
        // 为加载多语言所以用Js方式去调用后台变量（因为服务器控件客户端控件不能直接调用后台变量，但客户端控件可以直接调用）
        var _MSGSetPassword = "<%= this.MSGSetPassword %>";
        var _MSGPass = "<%= this.MSGPass %>";
        var _MSGLock = "<%= this.MSGLock %>";
        var _MSGDelete = "<%= this.MSGDelete %>";
        // 加载事件OnClientClick
        function OnInit() {
            var tmpElements = document.getElementsByTagName('a');
            for (var i = 0; i < tmpElements.length; i++) {
                var tmpElement = tmpElements[i];
                var tmpElementId = tmpElement.id;
                // 循环 asp:LinkButton 控件
                switch (tmpElementId) {
                    case "btnSetPassword":
                        // 确认要设置密码吗？
                        tmpElement.onclick = function () {
                            return CheckSelectAnyOne(_MSGSetPassword);
                        }
                        break;
                    case "btnPass":
                        // 确认要解锁吗？
                        tmpElement.onclick = function () {
                            return CheckSelectAnyOne(_MSGPass);
                        }
                        break;
                    case "btnLock":
                        // 确认要锁定用户吗？
                        tmpElement.onclick = function () {
                            return CheckSelectAnyOne(_MSGLock);
                        }
                        break;
                    case "btnDelete":
                        // 确认要删除吗？
                        tmpElement.onclick = function () {
                            return CheckSelectAnyOne(_MSGDelete);
                        }
                        break;
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <!-- 内容页布局开始 -->
    <table class="TableContent" border="0" cellspacing="0">
        <tr>
            <td class="TableContentTittle">
                <table border="0" class="tablecontenthead" cellspacing="0" cellpadding="3">
                    <!-- 标题栏开始 -->
                    <tr>
                        <td class="tablecontenthead1">
                            <img src="../../../../Images/common/icon/users.png" align="absmiddle" />
                            <asp:Literal ID="ltlTittle" runat="server" Text="用户管理"></asp:Literal>
                        </td>
                    </tr>
                    <!-- 标题栏结束 -->
                    <!-- 工具条开始 -->
                    <tr>
                        <td class="tablecontenthead2">
                            <!-- 全选/全不选开始 -->
                            <asp:LinkButton ID="btnCheckAll" runat="server" CssClass="button" OnClientClick="return ButtonCheckAll('gridView_ctl01_chkAll');">
                    <span>
                        <img alt="" src="../../../../Images/common/icon/checked.gif" border="0" align="absmiddle" title="<%=this.ButtonCheckAll %>" />
                        <%=this.ButtonCheckAll%>
                    </span>
                            </asp:LinkButton>
                            <!-- 全选/全不选结束 -->
                            <!-- 注册用户开始 -->
                            <asp:LinkButton ID="btnRegistration" runat="server" CssClass="button" OnClick="btnRegistration_Click">
                    <span>
                        <img alt="" src="../../../../images/common/icon/registon.gif" border="0" align="absmiddle" title="<%=this.ButtonRegistration %>" />
                        <%=this.ButtonRegistration%>
                    </span>
                            </asp:LinkButton>
                            <!-- 注册用户结束 -->
                            <!-- 密码开始 -->
                            <asp:LinkButton ID="btnSetPassword" runat="server" CssClass="button" OnClick="btnSetPassword_Click">
                    <span>
                        <img alt="" src="../../../../Images/common/icon/page_key.gif" border="0" align="absmiddle" title="<%=this.ButtonSetPassword%>" />
                        <%=this.ButtonSetPassword%>
                    </span>
                            </asp:LinkButton>
                            <!-- 密码结束 -->
                            <!-- 解锁开始 -->
                            <asp:LinkButton ID="btnPass" runat="server" CssClass="button" OnClick="btnPass_Click">
                    <span>
                        <img alt="" src="../../../../Images/Common/icon/hmenu-unlock.gif" border="0" align="absmiddle" title="<%=this.ButtonPass %>" />
                        <%=this.ButtonPass%>
                    </span>
                            </asp:LinkButton>
                            <!-- 解锁结束 -->
                            <!-- 锁定开始 -->
                            <asp:LinkButton ID="btnLock" runat="server" CssClass="button" OnClick="btnLock_Click">
                    <span>
                        <img alt="" src="../../../../Images/Common/icon/hmenu-lock.gif" border="0" align="absmiddle" title="<%=this.ButtonLock %>" />
                        <%=this.ButtonLock%>
                    </span>
                            </asp:LinkButton>
                            <!-- 锁定结束 -->
                            <!-- 删除开始 -->
                            <asp:LinkButton ID="btnDelete" runat="server" CssClass="button" OnClick="btnDelete_Click">
                    <span>
                        <img alt="" src="../../../../Images/Common/icon/coop_del.gif" border="0" align="absmiddle" title="<%=this.ButtonDelete %>"/>
                        <%=this.ButtonDelete%>
                    </span>
                            </asp:LinkButton>
                            <!-- 删除结束 -->
                            <!-- 控制框架布局工具开始 -->
                            <table style="width: 120px; float: right" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                        <!-- 添加到收藏夹开始 -->
                                        <img class="imglink" align="absmiddle" style="margin-left: 5px;" src="../../../../Images/common/icon/favorite.gif"
                                            title="<%=this.ToolbarFavorite %>" />
                                        <!-- 显示隐藏左框架结束 -->
                                        <img id="showhideleftimgid" class="imglink" align="absmiddle" style="margin-left: 5px;"
                                            src="../../../../Images/common/icon/showhideleft.gif" onclick="ControlLeft();"
                                            title="<%=this.ToolbarShowhideLeftFrame %>" />
                                        <!-- 显示隐藏上框架开始 -->
                                        <img id="showhidetopimgid" class="imglink" align="absmiddle" style="margin-left: 5px;"
                                            src="../../../../Images/common/icon/showhidetop.gif" onclick="ControlTop();"
                                            title="<%=this.ToolbarShowhideTopFrame %>" />
                                        <!-- 显示隐藏上框架结束 -->
                                        <!-- 帮助开始 -->
                                        <img class="imglink" align="absmiddle" style="margin-left: 5px;" src="../../../../Images/common/icon/help.gif"
                                            title="<%=this.ToolbarHelp %>" />
                                        <!-- 帮助结束 -->
                                    </td>
                                </tr>
                            </table>
                            <!-- 控制框架布局工具结束 -->
                        </td>
                    </tr>
                    <!-- 工具条结束 -->
                </table>
            </td>
        </tr>
        <!-- 查询栏开始 -->
        <tr>
            <td class="TableContentSearch25">
                <fieldset id="fieldsetSearch" class="fieldset25">
                    <legend><span>
                        <img id="imgsearch" runat="server" src="~/Images/Common/icon/search_icon.gif" onclick="FieldSetVisual('tdSearch','divSearch','fieldsetSearch','imgsearch')" />
                        &nbsp;
                        <asp:Literal ID="ltlSearch" runat="server" Text="查询"></asp:Literal>
                    </span></legend>
                    <div id="divSearch" class="divsearch">
                        <table class="TableContentSeach25" border="0" cellspacing="0">
                            <tr>
                                <td id="tdSearch" class="TableContentSeach25One">
                                    <asp:Literal ID="ltlRole" runat="server" Text="角色："></asp:Literal>
                                    <asp:DropDownList ID="cmbRole" Width="125px" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cmbRole_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <asp:Literal ID="ltlSearchContent" runat="server" Text="查询内容："></asp:Literal>&nbsp;
                                    <asp:TextBox ID="txtSearch" runat="server" EnableTheming="True" CssClass="Input ColorBlur"
                                        onBlur="this.className='Input ColorBlur';" onfocus="this.className='Input ColorFocus';"
                                        MaxLength="20"></asp:TextBox>
                                    &nbsp;
                                    <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="buttonshorts" OnClick="btnSearch_Click" />
                                    &nbsp;&nbsp;
                                </td>
                                <td class="TableContentSeach25Ones">
                                    <asp:CheckBox runat="server" ID="ckbEnabled" Checked="true" Text="只显示有效的" CssClass="Checked" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
            </td>
        </tr>
        <!-- 查询栏结束 -->
        <!-- 数据列表开始 -->
        <tr>
            <td class="TableContentList">
                <div style="width: 100%; height: 100%; overflow: auto; border: 0px;">
                    <table class="tablelist" border="0" cellspacing="0" width="100%">
                        <!-- 数据容器开始 -->
                        <tr>
                            <td class="listcontent">
                                <asp:GridView ID="gridView" DataKeyNames="Id" CssClass="GridViewStyle" runat="server" Width="100%"
                                    AutoGenerateColumns="false" AllowSorting="true" OnSorting="gridView_Sorting"
                                    OnRowDataBound="gridView_RowDataBound" OnRowEditing="gridView_RowEditing" OnRowDeleting="gridView_RowDeleting">
                                    <Columns>
                                        <asp:TemplateField HeaderText="No">
                                            <ItemTemplate>
                                                <%#(aspNetPager.CurrentPageIndex - 1) * aspNetPager.PageSize + Container.DataItemIndex + 1%>
                                            </ItemTemplate>
                                            <ItemStyle Width="30px" Wrap="False" CssClass="number" />
                                            <HeaderStyle Wrap="False" Font-Bold="False" />
                                        </asp:TemplateField>
                                        <asp:TemplateField>
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkAll" onClick="CheckAll(this.id);" runat="server" ToolTip="<%# this.CheckedCheckAll %>" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkSelected" onClick="CheckItem('gridView_ctl01_chkAll');" runat="server" />
                                            </ItemTemplate>
                                            <HeaderStyle Font-Bold="False" Wrap="False" />
                                            <ItemStyle Width="30px" HorizontalAlign="Center" Wrap="False" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="UserFrom" HeaderText="来源" HtmlEncode="False" SortExpression="UserFrom">
                                            <HeaderStyle Font-Bold="False" />
                                            <ItemStyle Wrap="False" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="UserName" HeaderText="用户名" HtmlEncode="False" SortExpression="UserName">
                                            <HeaderStyle Font-Bold="False" />
                                            <ItemStyle Wrap="False" Width="150px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Realname" HeaderText="姓名" HtmlEncode="False" SortExpression="Realname">
                                            <HeaderStyle Font-Bold="False" />
                                            <ItemStyle Wrap="False" Width="150px" />
                                        </asp:BoundField>
                                        <asp:BoundField HeaderText="默认角色" DataField="RoleName" SortExpression="RoleName">
                                            <HeaderStyle Font-Bold="False" />
                                            <ItemStyle Wrap="False" Width="120px" />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="有效" SortExpression="Enabled">
                                            <ItemTemplate>
                                                <%# DataBinder.Eval(Container, "DataItem.Enabled").ToString().Equals("1") ? this.EnableState : this.DisableState%>
                                            </ItemTemplate>
                                            <HeaderStyle Font-Bold="False" />
                                            <ItemStyle HorizontalAlign="Center" Wrap="False" Width="40px" />
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="备注" DataField="Description" SortExpression="Description">
                                            <ItemStyle />
                                            <HeaderStyle Font-Bold="False" />
                                        </asp:BoundField>
                                        <asp:CommandField HeaderText="编辑" ShowEditButton="true" EditText="&lt;img border=0 src=&quot;../../../../Images/common/icon/shortcut.gif&quot; alt=&quot;编辑&quot; /&gt;">
                                            <HeaderStyle Font-Bold="False" Wrap="false" />
                                            <ItemStyle Width="40px" VerticalAlign="Middle" HorizontalAlign="Center" Wrap="false" />
                                        </asp:CommandField>
                                        <asp:CommandField HeaderText="删除" ShowDeleteButton="True" DeleteText="&lt;img src=&quot;../../../../Images/common/icon/attach_delete.gif&quot; border=&quot;0&quot; alt=&quot;删除&quot;/&gt;">
                                            <ItemStyle Width="40px" VerticalAlign="Middle" HorizontalAlign="Center" Wrap="True" />
                                            <HeaderStyle Font-Bold="False" />
                                        </asp:CommandField>
                                    </Columns>
                                    <EmptyDataTemplate>
                                        <div>
                                            <%#this.ToopTipSearch %></div>
                                    </EmptyDataTemplate>
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                    <PagerStyle CssClass="GridViewPagerStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <!-- 数据容器结束 -->
                        <!-- 分页开始 -->
                        <tr>
                            <td class="listpager">
                                <webdiyer:AspNetPager ID="aspNetPager" runat="server" Width="100%" ShowPageIndexBox="Always"
                                    HorizontalAlign="Right" ShowCustomInfoSection="Left" AlwaysShow="true" CssClass="aspager"
                                    TextBeforePageIndexBox="跳转到第" TextAfterPageIndexBox="页" PageSize="20" CurrentPageIndex="39"
                                    FirstPageText="首页" LastPageText="尾页" PrevPageText="上页" NextPageText="下页" PageIndexBoxType="TextBox"
                                    ShowNavigationToolTip="True" PageIndexBoxClass="indextext" SubmitButtonClass="indexbutton"
                                    OnPageChanged="aspNetPager_PageChanged" SubmitButtonText="Go" AlwaysShowFirstLastPageNumber="True"
                                    CustomInfoTextAlign="Left">
                                </webdiyer:AspNetPager>
                            </td>
                        </tr>
                        <!-- 分页结束 -->
                    </table>
                </div>
            </td>
        </tr>
        <!-- 数据列表结束 -->
    </table>
    <!-- 内容页布局结束 -->
    <asp:HiddenField ID="txtPleseSelect" runat="server" />
    <asp:HiddenField ID="hdfSearch" runat="server" Value="提示信息：未找到查询内容。" />
    <asp:HiddenField ID="hdfDeleteSuccess" runat="server" Value="提示信息：删除成功。" />
    <asp:HiddenField ID="hdfDeleteLose" runat="server" Value="提示信息：删除失败。" />
    <asp:HiddenField ID="hdfPassSuccess" runat="server" Value="提示信息：解锁成功。" />
    <asp:HiddenField ID="hdfPassLose" runat="server" Value="提示信息：解锁失败。" />
    <asp:HiddenField ID="hdfLockSuccess" runat="server" Value="提示信息：锁定成功。" />
    <asp:HiddenField ID="hdfLockLose" runat="server" Value="提示信息：锁定失败。" />
    <script language="javascript" type="text/javascript">
        //初始化事件
        OnInit();
    </script>
    </form>
</body>
</html>
